package com.wicket.okrapp.web.contorller;
import com.wicket.okrapp.biz.service.dto.req.*;
import com.wicket.okrapp.biz.service.dto.res.*;
import com.github.pagehelper.Page;
import com.wicket.okrapp.biz.service.CycleStageDataService;
import com.wicket.okrapp.common.util.CommonFunctionHelper;
import com.wicket.okrapp.common.ro.OkrResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/app/cycleStageData/")
public class CycleStageDataController {
    @Autowired
    CycleStageDataService  cycleStageDataService;
/**
   * D3-查询阶段工作总结内容详情
   */
    @PostMapping("queryStaWorkSumConDetail")
    public OkrResult<QueryStaWorkSumConDetailRespDto> queryStaWorkSumConDetail(@RequestBody @Validated QueryStaWorkSumConDetailReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryStaWorkSumConDetail(reqDTO));
    }

  /**
   * D3-查询周期阶段资料列表
   */
    @PostMapping("queryCycleStageDataList")
    public OkrResult<QueryCycleStageDataListRespDto> queryCycleStageDataList(@RequestBody @Validated QueryCycleStageDataListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryCycleStageDataListRespDto retData = cycleStageDataService.queryCycleStageDataList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }
/**
   * D3-3新增周期阶段资料(公共)
   */
    @PostMapping("addCycleStageDataCom")
    public OkrResult<AddCycleStageDataComRespDto> addCycleStageDataCom(@RequestBody @Validated AddCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.addCycleStageDataCom(reqDTO));
    }
/**
   * D3-3更新周期阶段资料
   */
    @PostMapping("refreshCycleStageData")
    public OkrResult<RefreshCycleStageDataRespDto> refreshCycleStageData(@RequestBody @Validated RefreshCycleStageDataReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.refreshCycleStageData(reqDTO));
    }
/**
   * D3-新增周期阶段资料
   */
    @PostMapping("addCycleStageData")
    public OkrResult<AddCycleStageDataRespDto> addCycleStageData(@RequestBody @Validated AddCycleStageDataReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.addCycleStageData(reqDTO));
    }
/**
   * D3-查询未发布的汇报问题详情
   */
    @PostMapping("queryQuestionOfReportingTaskDetail")
    public OkrResult<QueryQuestionOfReportingTaskDetailRespDto> queryQuestionOfReportingTaskDetail(@RequestBody @Validated QueryQuestionOfReportingTaskDetailReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryQuestionOfReportingTaskDetail(reqDTO));
    }
/**
   * D3-3查询周期阶段资料详情(公共)
   */
    @PostMapping("queryCycleStageDataDetailCom")
    public OkrResult<QueryCycleStageDataDetailComRespDto> queryCycleStageDataDetailCom(@RequestBody @Validated QueryCycleStageDataDetailComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryCycleStageDataDetailCom(reqDTO));
    }
/**
   * D3-查询周期阶段资料列表(公共)
   */
    @PostMapping("queryCycleStageDataListCom")
    public OkrResult<QueryCycleStageDataListComRespDto> queryCycleStageDataListCom(@RequestBody @Validated QueryCycleStageDataListComReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryCycleStageDataListComRespDto retData = cycleStageDataService.queryCycleStageDataListCom(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }
/**
   * D3-3删除周期阶段资料(公共)
   */
    @PostMapping("deleteCycleStageDataCom")
    public OkrResult<DeleteCycleStageDataComRespDto> deleteCycleStageDataCom(@RequestBody @Validated DeleteCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.deleteCycleStageDataCom(reqDTO));
    }
/**
   * D3-3更新周期阶段资料(公共)
   */
    @PostMapping("refreshCycleStageDataCom")
    public OkrResult<RefreshCycleStageDataComRespDto> refreshCycleStageDataCom(@RequestBody @Validated RefreshCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.refreshCycleStageDataCom(reqDTO));
    }
/**
   * D3-查询汇报任务问题详情(公共)
   */
    @PostMapping("queryQuestionOfReportingTaskDetailCom")
    public OkrResult<QueryQuestionOfReportingTaskDetailComRespDto> queryQuestionOfReportingTaskDetailCom(@RequestBody @Validated QueryQuestionOfReportingTaskDetailComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryQuestionOfReportingTaskDetailCom(reqDTO));
    }
/**
   * 11111D3-查询编辑状态周期阶段资料内容详情
   */
    @PostMapping("queryEditStatusCycleStageDataDetail")
    public OkrResult<QueryEditStatusCycleStageDataDetailRespDto> queryEditStatusCycleStageDataDetail(@RequestBody @Validated QueryEditStatusCycleStageDataDetailReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryEditStatusCycleStageDataDetail(reqDTO));
    }
/**
   * D3-执行周期阶段资料相关文档处理(公共)
   */
    @PostMapping("implementHandleCycleStageDataDocCom")
    public OkrResult<ImplementHandleCycleStageDataDocComRespDto> implementHandleCycleStageDataDocCom(@RequestBody @Validated ImplementHandleCycleStageDataDocComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementHandleCycleStageDataDocCom(reqDTO));
    }
/**
   * D3-执行阶段工作总结内容资料处理(公共)
   */
    @PostMapping("implementHandleStaWorSumConCom")
    public OkrResult<ImplementHandleStaWorSumConComRespDto> implementHandleStaWorSumConCom(@RequestBody @Validated ImplementHandleStaWorSumConComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementHandleStaWorSumConCom(reqDTO));
    }
/**
   * D3-执行解决思路资料处理(公共)
   */
    @PostMapping("implementHandleSolvingIdeasCom")
    public OkrResult<ImplementHandleSolvingIdeasComRespDto> implementHandleSolvingIdeasCom(@RequestBody @Validated ImplementHandleSolvingIdeasComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementHandleSolvingIdeasCom(reqDTO));
    }
/**
   * D3-执行问题总结资料处理(公共)
   */
    @PostMapping("implementHandleSumOfProCom")
    public OkrResult<ImplementHandleSumOfProComRespDto> implementHandleSumOfProCom(@RequestBody @Validated ImplementHandleSumOfProComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementHandleSumOfProCom(reqDTO));
    }
/**
   * D3-执行分析工作周期更新切片(周期阶段资料)
   */
    @PostMapping("implementAnalyseWorkCycleUpdateSliceCom")
    public OkrResult<ImplementAnalyseWorkCycleUpdateSliceComRespDto> implementAnalyseWorkCycleUpdateSliceCom(@RequestBody @Validated ImplementAnalyseWorkCycleUpdateSliceComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementAnalyseWorkCycleUpdateSliceCom(reqDTO));
    }
/**
   * D3执行分析是否工作周期(公共)
   */
    @PostMapping("implementAnalyseIsWorkCycleCom")
    public OkrResult<ImplementAnalyseIsWorkCycleComRespDto> implementAnalyseIsWorkCycleCom(@RequestBody @Validated ImplementAnalyseIsWorkCycleComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementAnalyseIsWorkCycleCom(reqDTO));
    }
/**
   * D3-批量查询周期阶段资料列表（by目标周期ID）
   */
    @PostMapping("batchQueryCycleStageDataListByIdsCom")
    public OkrResult<BatchQueryCycleStageDataListByIdsComRespDto> batchQueryCycleStageDataListByIdsCom(@RequestBody @Validated BatchQueryCycleStageDataListByIdsComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.batchQueryCycleStageDataListByIdsCom(reqDTO));
    }
/**
   * D3批量删周期阶段资料(公共)
   */
    @PostMapping("batchDeleteCycleStageDataCom")
    public OkrResult<BatchDeleteCycleStageDataComRespDto> batchDeleteCycleStageDataCom(@RequestBody @Validated BatchDeleteCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.batchDeleteCycleStageDataCom(reqDTO));
    }
/**
   * D3-执行周期阶段资料发送消息处理(公共)
   */
    @PostMapping("implementCycleStageDataMessageCom")
    public OkrResult<ImplementCycleStageDataMessageComRespDto> implementCycleStageDataMessageCom(@RequestBody @Validated ImplementCycleStageDataMessageComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementCycleStageDataMessageCom(reqDTO));
    }
/**
   * D3-执行周期阶段资料发送消息准备(公共)
   */
    @PostMapping("implementCycleStageDataMessagePrepareCom")
    public OkrResult<ImplementCycleStageDataMessagePrepareComRespDto> implementCycleStageDataMessagePrepareCom(@RequestBody @Validated ImplementCycleStageDataMessagePrepareComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementCycleStageDataMessagePrepareCom(reqDTO));
    }
/**
   * D3-执行周期阶段资料会话处理(公共)
   */
    @PostMapping("implementCycleStageDataConversationCom")
    public OkrResult<ImplementCycleStageDataConversationComRespDto> implementCycleStageDataConversationCom(@RequestBody @Validated ImplementCycleStageDataConversationComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementCycleStageDataConversationCom(reqDTO));
    }
/**
   * D3-查询下级周期阶段资料列表(公共)
   */
    @PostMapping("querySubCycleStageDataListCom")
    public OkrResult<QuerySubCycleStageDataListComRespDto> querySubCycleStageDataListCom(@RequestBody @Validated QuerySubCycleStageDataListComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.querySubCycleStageDataListCom(reqDTO));
    }
/**
   * D3批量存档周期阶段资料(公共)
   */
    @PostMapping("batchArchiveCycleStageDataCom")
    public OkrResult<BatchArchiveCycleStageDataComRespDto> batchArchiveCycleStageDataCom(@RequestBody @Validated BatchArchiveCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.batchArchiveCycleStageDataCom(reqDTO));
    }
/**
   * D3批量查询周期阶段资料(公共)
   */
    @PostMapping("batchQueryCycleStageDataCom")
    public OkrResult<BatchQueryCycleStageDataComRespDto> batchQueryCycleStageDataCom(@RequestBody @Validated BatchQueryCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.batchQueryCycleStageDataCom(reqDTO));
    }
/**
   * D3-执行周期阶段资料存档处理(公共)
   */
    @PostMapping("implementArchiveCycleStageDataCom")
    public OkrResult<ImplementArchiveCycleStageDataComRespDto> implementArchiveCycleStageDataCom(@RequestBody @Validated ImplementArchiveCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementArchiveCycleStageDataCom(reqDTO));
    }
/**
   * D3-查询工作任务周期阶段资料详情(公共)
   */
    @PostMapping("queryWorkTaskCycleStageDataDetailCom")
    public OkrResult<QueryWorkTaskCycleStageDataDetailComRespDto> queryWorkTaskCycleStageDataDetailCom(@RequestBody @Validated QueryWorkTaskCycleStageDataDetailComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryWorkTaskCycleStageDataDetailCom(reqDTO));
    }
/**
   * D3查询最新汇报资料列表(公共)
   */
    @PostMapping("queryNewestReportCycleStageDataListCom")
    public OkrResult<QueryNewestReportCycleStageDataListComRespDto> queryNewestReportCycleStageDataListCom(@RequestBody @Validated QueryNewestReportCycleStageDataListComReqDto reqDTO){
//    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryNewestReportCycleStageDataListComRespDto retData = cycleStageDataService.queryNewestReportCycleStageDataListCom(reqDTO);

//        retData.setPageNum(page.getPageNum());
//        retData.setPageSize(page.getPageSize());
//        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

/**
   * D3分析下级全部汇报完成(公共)
   */
    @PostMapping("analysisAllSubordinatesHaveCompletedReportCom")
    public OkrResult<AnalysisAllSubordinatesHaveCompletedReportComRespDto> analysisAllSubordinatesHaveCompletedReportCom(@RequestBody @Validated AnalysisAllSubordinatesHaveCompletedReportComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.analysisAllSubordinatesHaveCompletedReportCom(reqDTO));
    }
/**
   * D3查询汇报任务周期阶段资料列表(公共)
   */
    @PostMapping("queryReportTaskCycleStageDataListCom")
    public OkrResult<QueryReportTaskCycleStageDataListComRespDto> queryReportTaskCycleStageDataListCom(@RequestBody @Validated QueryReportTaskCycleStageDataListComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryReportTaskCycleStageDataListCom(reqDTO));
    }
/**
   * D3执行回写周期阶段资料(公共)
   */
    @PostMapping("implementRewriteCycleStageDataCom")
    public OkrResult<ImplementRewriteCycleStageDataComRespDto> implementRewriteCycleStageDataCom(@RequestBody @Validated ImplementRewriteCycleStageDataComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.implementRewriteCycleStageDataCom(reqDTO));
    }
/**
   * D3批量查询周期阶段资料列表ByIds(公共)
   */
    @PostMapping("batchQueryCycleStageDataListByMainIdsCom")
    public OkrResult<BatchQueryCycleStageDataListByMainIdsComRespDto> batchQueryCycleStageDataListByMainIdsCom(@RequestBody @Validated BatchQueryCycleStageDataListByMainIdsComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.batchQueryCycleStageDataListByMainIdsCom(reqDTO));
    }
/**
   * D3查询下级已验收的周期阶段资料列表(公共)
   */
    @PostMapping("queryLowEndCycleStageDataListCom")
    public OkrResult<QueryLowEndCycleStageDataListComRespDto> queryLowEndCycleStageDataListCom(@RequestBody @Validated QueryLowEndCycleStageDataListComReqDto reqDTO){
    return OkrResult.success(cycleStageDataService.queryLowEndCycleStageDataListCom(reqDTO));
    }
}
  